package com.heyun.service.impl;

//import cn.dev33.satoken.stp.StpUtil;
import com.heyun.entity.dto.LoginDTO;
import com.heyun.entity.pojo.StudentPOJO;
import com.heyun.mapper.PermissionMapper;
import com.heyun.service.PermissionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Objects;
import java.util.Random;
@Service
@Slf4j
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionMapper permissionMapper;
    @Override
    public ArrayList<StudentPOJO> login(LoginDTO loginDTO) {

        String email = loginDTO.getName() + "1@example.com";
        loginDTO.setEmail(email);
        log.info("用户进入：" + loginDTO);
        ArrayList<StudentPOJO> user = permissionMapper.login(loginDTO);
        if (user.isEmpty()) log.info("用户信息错误 : "+ user);
        return user;
    }

    @Override
    public Integer Register(StudentPOJO studentPOJO) {
//
        return 0;
    }
}
